<%@ page language="java" import="java.util.*" contentType="text/html"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <meta content="IE=11.0000" http-equiv="X-UA-Compatible">
  <meta name="GENERATOR" content="MSHTML 11.00.10586.494">
  <meta http-equiv="Content-Type" content="application/pdf; charset=utf-8">
  <title>北京市人民政府外事办公室领事保护教育服务平台——视频播放</title>
  <!-- 新 Bootstrap 核心 CSS 文件 -->
  <link rel="stylesheet" href='<c:url value="/share/bootstrap.css"></c:url>'>
  <link rel="stylesheet" href='<c:url value="/share/AllStyle.css"></c:url>'>
  <link rel="stylesheet" href='<c:url value="/share/video-js.css"></c:url>'>
  <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  <script type="text/javascript" src='<c:url value="/js/jquery.min.js"></c:url>'></script>
  <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  <script type="text/javascript" src='<c:url value="/js/bootstrap.min.js"></c:url>'></script>
  <script type="text/javascript" src='<c:url value="/js/all.js"></c:url>'></script>
  <script type="text/javascript" src='<c:url value="/js/prefixfree.min.js"></c:url>'></script>
  <script src="<c:url value='/js/serverCommonJs.js'></c:url>"></script>
<script src="<c:url value='/js/rqfCommon/rqfCommon.js'></c:url>"></script>
<style type="text/css">
body {
    -webkit-box-shadow: inset 0 0 18.75em rgba( 0, 0, 0, .5 );
    -moz-box-shadow: inset 0 0 18.75em rgba( 0, 0, 0, 5 );
    box-shadow: inset 0 0 18.75em rgba( 0, 0, 0, .5 );
}
#touxiang_true {
	margin-right: 10px;
	float: left;
	width: 36px;
	height: 36px;
	border-radius: 100%;
	display: block;
	line-height: 60px;
	color: #787d82;
	text-align: center;
	-webkit-transition: background-color 0.2s;
	-moz-transition: background-color 0.2s;
	transition: background-color 0.2s;
}

.vertical {
	margin: 0 8px;
	background: #dae1e6;
	display: inline-block;
	width: 1px;
	height: 24px;
	vertical-align: middle;
}

.body {
	width: 100%;
	height: 100%;
}

html,body{
	overflow-y: hidden;
}

.header-tool-news .header-tc-content {
    width: 302px;
    padding: 0 26px;
    line-height: 34px;
    right: -69px;
    text-align: center;
}
.header-tc-content {
	display: none;
    position: absolute;
    border: 1px solid #ccc;
    width: 370px;
    left: -183px;
    top: 40px;
    background-color: #fff;
    text-align: left;
    /* display: none; */
    z-index: 2;
    color: #4b4b4b;
    font-size: 12px;
    height: auto!important;
    min-height: 32px;
    height: 32px;
    box-shadow: 0 2px 5px #d5d5d5;
}

.header-tool-news .header-tc-content .header-tc-ct-bg {
    right: 76px;
}
.header-tc-ct-bg {
    position: absolute;
    top: -15px;
    left: 50%;
    width: 0;
    height: 0;
    border: 7px solid #ccc;
    border-color: transparent transparent #ccc;
    z-index: 5;
}

.header-tc-ct-bg:before {
    content: "";
    position: absolute;
    top: -7px;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid #fff;
    border-color: transparent transparent #fff;
    z-index: 3;
}
.news-title {
    line-height: 42px;
    overflow: hidden;
    border-bottom: 1px solid #2459aa;
    margin: 0 18px;
}
.news-list {
    margin: 0;
    padding: 0;
    max-height: 332px;
    overflow-y: auto;
    margin: 0 18px;
    position: relative;
}
.news-bottom {
    line-height: 42px;
    text-align: center;
    border-top: 1px solid #e0e6f1;
    background: #f6f6f6;
    color: rgb(180, 180, 180);
}
.news-title .news-title-ctx {
    color: #2459aa;
    font-size: 14px;
    float: left;
}
.news-bottom .news-more {
    color: #b4b4b4;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}
.news-item{
	line-height: 60px;
	border-bottom: 1px solid #e0e6f1;
}
.news-item:last-child {
    border-bottom: none;
}
.news-ctx-link{
  color: rgb(124, 124, 125);
  font-size: 14px;
  overflow: hidden;
  width: 300px;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  float: left;
}
.news-ctx{
	position: relative;
    overflow: hidden;
}
.wh_Home_news{
	float: left;
	padding-bottom: 10px;
}

@media screen and (min-width:1189px){
  .Interface_center{
  	width: 1190px !important;
  }
}
#touxiang_true {
	margin-right: 10px;
	float: left;
	width: 30px;
	height: 30px;
	border-radius: 100%;
	margin-top: 3px;
	display: block;
	line-height: 60px;
	color: #787d82;
	text-align: center;
	-webkit-transition: background-color 0.2s;
	-moz-transition: background-color 0.2s;
	transition: background-color 0.2s;
}
a#dropdownMenu1{
	padding: 3px 12px;
}

.vertical {
	margin: 0 8px;
	background: #dae1e6;
	display: inline-block;
	width: 1px;
	height: 24px;
	vertical-align: middle;
}

.body {
	width: 100%;
	height: 100%;
}

#IsTrueInfo{
	width: 150px;
	text-align: center;
	//background: #fff;
	color: #295c96;
	line-height: 65px;
	border-radius: 2px;
	border: 4px solid rgba(0,0,0,.2);
	-webkit-box-shadow: 1px 1px 10px rgba(0,0,0,1);
    box-shadow: 1px 1px 10px rgba(0,0,0,1);
}
#home_video_audio_test{
	float: left;
}

.video_content_right_right>div{
	height: 50%;
}

.vjs-default-skin .vjs-control:before{
	line-height: 36px;
}

html, body {
	background: #fff;
	box-shadow: inset 0 0 18.75em rgb(255, 255, 255);
}

center {
	background: url(/eduPlatform/share/images/audioBg.png) 0 0 no-repeat;
	background-size: 100% 100%;
}

.des {
	float: left;
}

.finishButton a {
	margin-bottom: 5px;
}

div .finishButton {
	box-shadow: none;
	background: #fff;
}

.video_content_right_right_content_1, .video_content_right_right_content_2 {
    border: 1px solid #E5EBEF;
}

.zh5 {
    margin-left: 70px;
}

.r {
    width: 360px;
}
#home_video_audio_test{
	position: relative;
}
#absolute_switch{
	/* position: absolute; */
	margin-right: 10px;
    right: 10px;
    top: 8px;
    z-index: 99999;
}
#example_video_1{
	widht: 100%;
	height: 100%;
}
#Video_Outline{
    position: relative;
    overflow: hidden;
    text-align: left;
    background: #fff;
    height: 251px;
    overflow-y: scroll;
}
#Video_Outline>a{
	/* border-bottom: 1px dashed #cecfd0; */
    background: #fff;
	word-wrap: break-word;
	display: block;
    font-size: 16px;
    color: #7a7a7a;
    padding: 0px 10px;
}
.Video_Outline_AClick{
	color: #69aac7 !important;
}
.Video_Outline_AClick>div:nth-child(1){
	background: #84bdfd !important;
}
.Video_Outline_AClick>div:nth-child(2){
	 text-decoration: underline !important;
}
#Video_Outline>a>div:nth-child(1){
    width: 16px;
    height: 16px;
    display: block;
    float: left;
    position: relative;
    top: 8px;
    background: #307698;
    border-radius: 100%;
}
#Video_Outline>a>div:nth-child(2){
	padding: 5px 0;
	width: 260px;
    position: relative;
    display: block;
    left: 30px;
    border-bottom: 1px dashed #cecfd0;
}
</style>
</head>
<body>
 <div class="home_header">
		<div class="Interface_center row" style="width: auto;">
			<div class="col-xs-6" style="height: 42px;position: relative;overflow: hidden;">
				<div class="home_header_left">
					<span><img
						src="<c:url value='/share/images/book.png'></c:url>">北京市人民政府外事办公室领事保护教育服务平台</span>
				</div>
			</div>
			<div class="col-xs-6" style="height: 42px;">
				<div class="home_header_right"
					style="position: relative;height: 42px;">
					<c:if test="${not empty  userName}">
						<div class="wh_Home_news">
							<div class="header-tc-content">
			                    <span class="header-tc-ct-bg"></span>
			                    <div class="news-header">
			                    	<div class="news-title clr">
			                    		<span class="news-title-ctx">消息</span>
			                    	</div>
			                    	<ul class="news-list" id="news-list">
			                    	</ul>
			                    	<div class="news-bottom clearfix">
			                    		<a class="news-more" href="javascript:;" onclick="naviClick(6)">查看所有消息>></a>
			                    	</div>
			                    </div>
			                </div>
							<a id="remindId" href="javascript:;"
								style="display: block; width: 18px;text-align: center; top: 5px; left: 20px; background: #e93a44; position: absolute; margin: 0; border: 0; border-radius: 100%; color: #fff; padding: 0px 4px; font-size: 12px;"></a>
							<img src="<c:url value='/share/images/black1.png'></c:url>"
								id="touxiang_lingdang"
								style="width: 18.85px; height: 24px; margin-top: 7px; cursor: pointer;">
							<span class="vertical" style="margin: 0 20px; margin-top: 10px;"></span>
						</div>
						<div class="home_login_true_2" style="float: right; margin-top: 3px;">
							<c:if test="${empty url}">
							<img src="<c:url value='/share/images/head.jpg'/>" id="touxiang_true"/>
							</c:if>
							<c:if test="${not empty url}">
							<img src="${fileServer}${url}" id="touxiang_true"/>
							</c:if>
							<div class="home_login_true_2" style="float: right;">
								<div class="dropdown">
									<a class="btn btn-default dropdown-toggle" id="dropdownMenu1"
										style="color: #295c96; border: none; font-size: 16px; margin-top: 6px;">
										${userName} <span class="caret" style="margin-left: 10px;"></span>
									</a>
									<ul class="dropdown-menu">
										<li><a href="<c:url value='/login/perfectInfo'></c:url>"
											id="login_perfect">个人资料</a></li>
										<li><a href="<c:url value='/login/logout'></c:url>"
											id="login_remove">退出</a></li>
									</ul>
								</div>
							</div>
					</c:if>
					<c:if test="${empty  userName}">
						<a href="<c:url value='/login'></c:url>">登录</a>
						<a href="<c:url value='/login/register'></c:url>">注册</a>
					</c:if>
				</div>
			</div>
		</div>
	</div>
  <center style="margin: 0 auto;min-width: 1190px;">
  <div class="video_content" style="width: 1190px; margin: 0 auto; position: relative; overflow: hidden;">
	  <div id="home_video_audio_test" style="width: 100%;height: 100%;">
	    <%-- <video class="video-js vjs-default-skin vjs-big-play-centered" id="example_video_1" preload="auto" controls="" poster='<c:url value="/share/images/"></c:url>' data-setup="{}" autoplay="autoplay" style="width:100%;height:100%;">
	        <source src="${sourceUrl}" type="video/${fileType1}"> 
	      </video> --%>
	      <iframe id="example_video_1" name="video_1" src="<c:url value="/study/course/VideoIframe/${id}"></c:url>" frameborder="0" class="video_content_right_right_content_1_content" style="width: 100%;height: 100%;"></iframe>
      </div>
      <div class="video_content_right" style="background: #fff;">
        <a class="glyphicon back_right" style="height: 100%; top: 0; line-height: 0;cursor:pointer;background: #DCDAD0;">
        	<%-- <img src='<c:url value="/share/images/Arrow.png"></c:url>' id="block_video"></img> --%>
        </a>
        <div class="video_content_right_right">
          <div class="video_content_right_right_content_1">
          <div class="video_content_right_right_title1">
            <div class="col-xs-12 video_content_right_right_title1_a" style="border-bottom: 0;position: relative;">
            	<a href="javascript:;">课件</a>
            	<!-- <div id="absolute_switch">切换视频/PPT</div> -->
            	<div id="absolute_switch" class="home_header_right">
					<a href="javascript:;" style="margin: 0;">切换</a>
				</div>
            </div>
            <!-- <div class="col-xs-6"><a href="javascript:;">目录</a></div> -->
          </div>
          <div class="video_content_right_right_content_1_content" id="switch_PPT" style="overflow-y:hidden;">
				<iframe id="switch_PPT_iframe" src="<c:url value="/study/course/pdf/${id}"></c:url>" frameborder="0" class="video_content_right_right_content_1_content" style="width: 100%;height: 100%;"></iframe>
          </div>
          <input id="home_video_audio_test_index" value="${type}" type="hidden"></input>
          </div>
          <div class="video_content_right_right_content_2">
          <div class="video_content_right_right_title1">
            <div class="col-xs-6 video_content_right_right_title1_a">
              <a href="javascript:;">大纲</a>
              <!-- <a class="glyphicon glyphicon-plus create_plus" style=""><font style="top: 8px;position: relative;">创建</font></a> -->
            </div>
            <div class="col-xs-6"><a href="javascript:;">反馈</a></div>
          </div>
          <div class="video_content_right_right_content_2" id="video_content_right_right_content_2_right">
            <div class="video_content_right_right_content_2_copys">
              <div class="main" style="position: relative;"> 
              	<p style="position: absolute;top: 85px;left: 100px;text-align: center;line-height: 15px;">
              		请登录<br></br>登陆后即可查看大纲
              	</p>
              	<div id="Video_Outline">
              	</div>
                <!-- <div class="content" style="padding: 2px;">
                	<p id="contentText" contenteditable="true" style="text-align: left;margin: 0;"></p>
                </div>
                <div class="sidebar">
                  <div class="exitMenu">
                    <div class="finishButton" style="width: 356px;">
                      <a href="javascript:void(0);" id="publish" class="col-xs-6" style="background: #8ac0ff;">保存</a>
                      <a href="javascript:void(0);" id="delete" class="col-xs-6" style="background: #aeaeae;">清空笔记</a>
                    </div>
                  </div>
                </div> -->
              </div>
            </div>
            <div class="video_content_right_right_content_2_copys video_content_right_right_content_2_copys_r" style="padding: 10px;">
	            	<p style="position: absolute;top: 85px;left: 100px;text-align: center;line-height: 15px;">
	              		请登录<br></br>登陆后即可查看大纲
	              	</p>
              		<div class="r" style="border-radius: 5px 5px 0 0;">
              			<h4 style="margin: 0 auto;font-size: 14px;text-align: center;padding: 10px 0;color: #295C96;font-weight: 600;">总体评分</h4>
		                      <div class="zh5">
		                            <ul id="zh5ul_3" class="zh5ul_3">
		                                <li val="1" class=""></li>
		                                <li val="2" class=""></li>
		                                <li val="3" class=""></li>
		                                <li val="4" class=""></li>
		                                <li val="5" class=""></li>
		                            </ul>
		                            <div id="zh5_red_3" data_star=""></div>
		                        </div>
		                      <span class="des">可接受度</span>
	                     </div>
	                     <div class="r" style="margin-bottom: 10px;border-radius: 0 0 5px 5px;">
		                      <div class="zh5">
		                            <ul id="zh5ul_4" class="zh5ul_4">
		                                <li val="1" class=""></li>
		                                <li val="2" class=""></li>
		                                <li val="3" class=""></li>
		                                <li val="4" class=""></li>
		                                <li val="5" class=""></li>
		                            </ul>
		                            <div id="zh5_red_4" data_star=""></div>
		                        </div>
		                      <span class="des">课程内容质量</span>
	                     </div>
              		<div class="r" style="position: relative; overflow: hidden;border-radius: 5px 5px 0 0;">
              		   <h4 style="margin: 0 auto;font-size: 14px;text-align: center;padding: 10px 0;color: #295C96;font-weight: 600;">个人评分</h4>
                       <div class="zh5">
                             <ul id="zh5ul" class="zh5ul">
                                 <li val="1" class=""></li>
                                 <li val="2" class=""></li>
                                 <li val="3" class=""></li>
                                 <li val="4" class=""></li>
                                 <li val="5" class=""></li>
                             </ul>
                             <div id="zh5_red" data_star=""></div>
                         </div>
                       <span class="des">可接受度</span>
                     </div>
                     <div class="r" style="border-radius: 0 0 5px 5px;">
                      <div class="zh5">
                            <ul id="zh5ul_2" class="zh5ul_2">
                                <li val="1" class=""></li>
                                <li val="2" class=""></li>
                                <li val="3" class=""></li>
                                <li val="4" class=""></li>
                                <li val="5" class=""></li>
                            </ul>
                            <div id="zh5_red_2" data_star=""></div>
                        </div>
                      <span class="des">课程内容质量</span>
                      <div style="width: 74px;margin: 0 auto;padding: 10px 0;">
	                      <button type="button" class="btn btn-success" id="btn_score" style="padding: 4px 12px;font-size: 12px;margin-top: 10px;">提交评分</button>
                      </div>
                    </div>
            	</div>
          	</div>
        </div>
        </div>
      </div>
  </div>
  </center>
  </div>
  
  <div id="IsTrueInfo" style="display: none;position: absolute;z-index: 9999;left: 50%;top:50%;">
  	<div style="background: #fff;">保存成功!</div>
  </div>
  
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-dialog">
	    <div class="modal-content" style="padding: 0 25px;">
	      <div class="modal-header" style="padding: 15px 0;border-bottom: 1px solid #1e519f;">
	        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
	        <h4 class="modal-title" id="myModalLabel" style="font-size: 16px;"></h4>
	      </div>
	      <div class="modal-body" style="color: #000;">
	      </div>
	      <div class="modal-body-details" style="position: relative;padding: 15px;border: 1px solid #e3e3e3;color: #000;">
	      </div>
	      <div class="modal-footer" style="border-top: 0;text-align: center;">
	        <button type="button" class="btn btn-primary" data-dismiss="modal" style="padding: 9px 35px;">确定</button>
	      </div>
	    </div>
	  </div>
	</div>
  
  <input type="text" id="video_Value" value="" style="display: none;"></input>
  <input type="text" id="video_start" value="" style="display: none;"></input>
  <script src='<c:url value="/js/video.js"></c:url>'></script>
    <script type="text/javascript">
    $("#home_video_audio_test").ready(function(){
    	setTimeout(function(){
    		$("#example_video_1").css({
        		"width": "100%",
        		"height": "100%"
        	})
    	})
    })
    var video_href = window.location.href;  //接收地址
    var temp_href = "";
    var course_id_href;//接收本课程的ID
   	var score_id_href = video_href.substring(video_href.lastIndexOf("/"));
   	video_href = video_href.substring(0,video_href.lastIndexOf("/"));
   	temp_href = video_href.split('').reverse().join('');//后面两个目录地址反转
   	temp_href = video_href.substring(video_href.lastIndexOf("/"));//再次进行截取
	var InitUrl = "<c:url value='/study/course/getVidoPptRel"+ temp_href +"'></c:url>";
	//初始化数组
	var InitArray;
	//实时时间
    var RealTime;
	//当前页码
	var IndexPage;
	var CurrentPage;
	//大纲数组
	var outlineValue;
	//大纲值
	var OutlineIndex;
	//大纲旧值
	var beforOutlineIndex;
	$.ajax({
		url: InitUrl,
		type: 'POST',
		dataType: 'JSON',
		data:{},
		success:function(data){
			var html = "";
			InitArray = data.vidoppt;
			outlineValue = data.contentppt;
			for(var i = 0; i < data.content.length; i++){
				html += '<a id="Video_Outline_'+ i +'" href="javascript:;"><div></div><div>'+ data.content[i] +'</div></a>';
			}
			$("#Video_Outline").html(html);
		},
		error:function(){
			//console.log();
		}
	});
    //获取所有节点播放、点击视频控制页码
    function getMsg(RealTime){
		for(var i = 0; i < outlineValue.length; i++){
    		if(CurrentPage < outlineValue[i]){
    			//OutlineTrack(CurrentPage);
    			return;
    		}
    	}
    }
    var InitSwitch = 0;
    setInterval(function(){
    	//旧值
    	var IndexPage = CurrentPage;
    	for(var i = 0;i < InitArray.length; i++){
		    if(RealTime >= InitArray[i]){
		    	//新值
		    	CurrentPage = i;
		    }
	    }
    	if(IndexPage < CurrentPage){
    		$('#switch_PPT_iframe').contents().find("#thumbnailView>a:eq("+ CurrentPage +")").click();
    		//大纲显示
    		OutlineTrack(CurrentPage);
    	}else if(IndexPage > CurrentPage){
    		$('#switch_PPT_iframe').contents().find("#thumbnailView>a:eq("+ CurrentPage +")").click();
    		//大纲显示
    		OutlineTrack(CurrentPage);
    	}
    },1000)
    //点击ppt控制视频
    function linkage(CurrentPage){
    	var InitTime = InitArray[CurrentPage];
    	//OutlineTrack(CurrentPage);
    	//Video初始化播放和指定时间
    	document.getElementById('example_video_1').contentWindow.VideoPlay(InitTime);
	}
    
    //大纲联动方法
    function OutlineTrack(CurrentPage){
    	var IntPage = parseInt(CurrentPage) + 1;
    	//PPT初始化调整当前页码样式和指定页码
    	$('#switch_PPT_iframe').contents().find("#thumbnailView>a:eq("+ CurrentPage +")").click();
    	for(var i = 0; i < outlineValue.length; i++){
    		if(CurrentPage < outlineValue[i]){
    			var IfIndex = beforOutlineIndex;
    			beforOutlineIndex = outlineValue.indexOf(outlineValue[i]);
	    		OutlineIndex = outlineValue.indexOf(outlineValue[i]);
	    		//大纲显示
	        	$("#Video_Outline a").removeClass('Video_Outline_AClick');
	        	$("#Video_Outline a:eq("+ OutlineIndex +")").addClass('Video_Outline_AClick');
	        	var scollT = $(".Video_Outline_AClick").offset().top - $("#Video_Outline").offset().top + $("#Video_Outline").scrollTop();
	        	$('#Video_Outline').animate({  
	                scrollTop: scollT  
	            }, 500);
	    		return;
    		}
    	}
    }
    
    //大纲点击
    $("#Video_Outline").on('click','a',function(){
    	//获取当前索引值
    	var index = $(this).index();
    	var OutlineTime;
    	if(index == 0){
    		OutlineTime = InitArray[index];
    		OutlineTrack(index);
    		//PPT初始化调整当前页码样式和指定页码
        	$('#switch_PPT_iframe').contents().find("#thumbnailView>a:eq("+ index +")").click();
    		//加载页面
        	document.getElementById('switch_PPT_iframe').contentWindow.Viewloading();
        	//Video初始化播放和指定时间
        	document.getElementById('example_video_1').contentWindow.VideoPlay(OutlineTime);
    	}else{
    		for(var i = 0; i < outlineValue.length; i++){
    			var SelectIndex = outlineValue[index-1];
    			OutlineTime = InitArray[SelectIndex];
    			OutlineTrack(SelectIndex  + 1);
    			//PPT初始化调整当前页码样式和指定页码
    	    	$('#switch_PPT_iframe').contents().find("#thumbnailView>a:eq("+ SelectIndex +")").click();
    	    	document.getElementById('switch_PPT_iframe').contentWindow.Viewloading();
    	    	//Video初始化播放和指定时间
    	    	document.getElementById('example_video_1').contentWindow.VideoPlay(OutlineTime);
	   			return;
    		}
    	}
    })
    function OutlineClick(index){
    	$("#Video_Outline a").removeClass('Video_Outline_AClick');
    	$("#Video_Outline a:eq("+ index +")").addClass('Video_Outline_AClick');
    	var scollT = $(".Video_Outline_AClick").offset().top - $("#Video_Outline").offset().top + $("#Video_Outline").scrollTop();
    	$('#Video_Outline').animate({  
            scrollTop: scollT  
        }, 500);
    }
    $(document).ready(function(){
    	//切换PPT/视频
    	var switch_PPT = $("#switch_PPT").html();
    	var home_video_audio_test = $("#home_video_audio_test").html();
    	$("#absolute_switch").click(function(){
    		$("#video_Value").attr('value','1');
    		$("#switch_PPT").html('');
    		$("#home_video_audio_test").html('');
    		if(!$(this).is(".absolute_switch_true")){
    			$(this).addClass("absolute_switch_true");
    			$("#switch_PPT").append(home_video_audio_test);
    			$("#home_video_audio_test").append(switch_PPT);
    		}else{
    			$(this).removeClass("absolute_switch_true");
    			$("#switch_PPT").append(switch_PPT);
    			$("#home_video_audio_test").append(home_video_audio_test);
    		}
    	})
    	
        $("#dropdownMenu1").mouseover(function(){
        	$(".dropdown-menu").show();
        });
        $(".dropdown-menu").mouseover(function(){
        	 $(".dropdown-menu").show(); 
         }).mouseout(function(){
            $(".dropdown-menu").hide();
         }); 
      })
    var userName = '${userName}';//获取用户值
    //判断用户是否登录
    if(userName == ""){
    	$(".video_content_right_right_content_2_copys>.main>*").hide();
    	$(".video_content_right_right_content_2_copys>.main>p").show();
    	$(".video_content_right_right_content_2_copys_r>*").hide();
    	$(".video_content_right_right_content_2_copys_r>p").show();
    }
    
    var NewsListHtml;
	var ContentHtml = "";
	var MsgTitle = "";
	var MsgDetailsHtml = "";
	$("#news-list").on("click","li>div>a",function(){
		var id = $(this).data('id');
		init_count();
		$(".modal-body").html(MsgDetailsHtml);
		$(".modal-body-details").html(ContentHtml);
		$("#myModalLabel").html(MsgTitle);
		init_msg(1);
	})
    
	var uuid = '${uuid}';
    init_msg();
	//获取消息推送信息
	function init_msg(type){
			var url = "<c:url value='/msg/list'></c:url>";
			$.ajax({
				url: url,
				type: 'POST',
				dataType: 'html',
				data:{
					"pageSize": 4,
					"uuid": uuid,
					"notRead": true
				},
				success:function(data){
					var obj = gridDataFormat(data);
					var html = "";
					var AlertHtml = "";
					if(obj.count == 0){
						html += '<li class="news-item clr">'+
					            	'<div class="news-ctx clr" style="text-align: center;">'+
				        				'目前没有新消息'+
				        			'</div>'+
				        		'</li>';
					}
					for(var i in obj.data){
						ContentHtml = obj.data[i].msgCon == null?"无":obj.data[i].msgCon;
						MsgTitle = obj.data[i].msgName == null?"无":obj.data[i].msgName;
						pushTime = obj.data[i].pushTime == null?"无":obj.data[i].pushTime;
						creater = obj.data[i].creater == null?"无":obj.data[i].creater;
						createTime = obj.data[i].createTime == null?"无":obj.data[i].createTime;
						createTime = createTime.substring(0,10) +"&nbsp;"+ createTime.substring(11,16);
						pushReason = obj.data[i].pushReason == null?"无":obj.data[i].pushReason;
					    MsgDetailsHtml = '<div style="width: 195px; float: left;">'+
						       			 	'接收人：'+ MsgTitle +''+
							      		 '</div>'+
							      		 '<div>'+
							      		 	 '推送时间：'+ pushTime +''+
							      		 '</div>'+
							      		 '<div style="width: 195px; float: left;">'+
							      			 '编制人：'+ creater +''+
							      		 '</div>'+
							      		 '<div>'+
							      			 '编制时间：'+ createTime +''+
							      		 '</div>'+
							      		 '<div>'+
							      			 '推送原因： '+ pushReason +''+
							      		 '</div>';
						AlertHtml = obj.data[i].type == "自定义"?'data-toggle="modal" data-target="#myModal" href="javascript:;"':'target="_blank" href="<c:url value="/surveyAnalyze/answerMv/'+ obj.data[i].relatedId +'"></c:url>"';
						html += '<li class="news-item clr" onclick="state_change('+ obj.data[i].id +')">'+
				            		'<div class="news-ctx clr">'+
				        				'<a class="news-ctx-link  blank_to" '+ AlertHtml +' href="javascript:;" data-url="/eduPlatform/msg/'+ obj.data[i].id +'" data-state="'+ obj.data[i].state +'" title="'+ obj.data[i].type +'—'+ obj.data[i].msgName +'">'+ obj.data[i].type +'—'+ obj.data[i].msgName +'</a>'+
				        				'<div class="news-type news-app11" style="width: 8px;height: 8px;border-radius: 50%;background: #eb3f3f;float: left;margin-top: 25px;margin-left: 15px;"></div>'+
				        			'</div>'+
				        		'</li>';
					}
					$("#news-list").html(html);
					$(".modal-body").html(MsgDetailsHtml);
					$(".modal-body-details").html(ContentHtml);
					$("#myModalLabel").html(MsgTitle);
					if(type != 1){
						$(".modal-body").html(MsgDetailsHtml);
						$(".modal-body-details").html(ContentHtml);
						$("#myModalLabel").html(MsgTitle);
					}
				},
				error:function(){
					//console.log();
				}
			});
		}
	
	//改变状态
	function state_change(id){
		var url = "<c:url value='/msg/read'></c:url>";
		$.ajax({
			url: url,
			type: 'POST',
			dataType: 'html',
			data:{
				"ids":id
			},
			success:function(data){
				if(data < 1){
					alert("阅读失败");
					location.reload();
				}
			},
			error:function(){
				//console.log();
			}
		});
	}
	
	init_count();
	//获取未读数
	function init_count(){
		var url = "<c:url value='/msg/count'></c:url>";
		$.ajax({
			url: url,
			type: 'POST',
			dataType: 'JSON',
			data:{
				"uuid": uuid,
				"notRead": true
			},
			success:function(data){
				if(data < 1){
					data = "";
				}else if(data > 9){
					data = "...";
				}
				$("#remindId").html(data);
			},
			error:function(){
				//console.log();
			}
		});
	}
    
    $(document).ready(function(){
      	//消息信息
        $(".wh_Home_news").hover(function(){
			$(".header-tc-content").show();
		},function(){
			$(".header-tc-content").hide();
		});
    });
    //console.log($("#example_video_1")[0].contentWindow);
    $(function(){
	    var myVid = document.getElementById("example_video_1");
	    //var video;
	    var fileId = '${fid1}' != ''?'${fid1}':$("#video_start").attr('value','0');
	    /* if(fileId == 0){
	    	$("#home_video_audio_test").css('width',1190 - 325+"px");
	    } */
	    var course_id = ${id};
	    var total_time;//总时长
	    //上次播放时间段|设定时间段
	    //myVid.currentTime = video;
	    //初始化配置
	//视频高度、宽度获取设置
	  $("#example_video_1").css({
		  width: $(".video_content").width() - 382+"px",
		  height: 590+"px"
	  });
	  $(".video_content_right_right_content_1_content").css({
		  width: 356+"px",
		  height: 32+"px"
	  });
	  $("#home_video_audio_test").css({
		  width: $(".video_content").width() - 382+"px",
		  height: 590+"px"
	  });
	
	  //展开收缩高度、宽度获取设置
	  $(".back_right").css({
	    height: 590+"px"
	  })
	
	  //右侧栏	
	  $(".video_content_right_right").css({
	    // width: $(window).width() - $("#example_video_1").width() - $(".back_right").width(),
	    width: 360+"px",
	    height: 590+"px"
	  });
	  
	  var RihgtVideo = $(".video_content_right_right_content_2").height() - $(".video_content_right_right_title1").height();
	  $("#contentText").css("height",215+"px");
	  $(".video_content_right_right_content_1_content").css("height",RihgtVideo);
	  $("#music_gif").css({
		  width: 360+"px",
		  height: $(".video_content_right_right_content_1_content").height() - 32+"px"
      });
	  $("body").css({
			height: $(window).height()
		})
	  
	  $("center").css({
		 height: $("body").height() - 42+"px"
	  });
	  $(".video_content").css({
		 top: ($(window).height() - $(".video_content").height() - 42)/2
	  });
	
	  //课件目录切换
	  $(".video_content_right_right_content_1>.video_content_right_right_title1>div").click(function(){
	    var index = $(this).index();
	    $(".video_content_right_right_content_1>.video_content_right_right_title1>div").removeClass("video_content_right_right_title1_a");
	    $(this).addClass("video_content_right_right_title1_a");
	    $(".video_content_right_right_content_1 .video_content_right_right_content_1_content>div").hide();
	    $(".video_content_right_right_content_1 .video_content_right_right_content_1_content>div:eq("+ index +")").show();
	  });
	
	  //笔记提问切换
	  $(".video_content_right_right_content_2>.video_content_right_right_title1>div").click(function(){
	    var index = $(this).index();
	    $(".video_content_right_right_content_2>.video_content_right_right_title1>div").removeClass("video_content_right_right_title1_a");
	    $(this).addClass("video_content_right_right_title1_a");
	    $(".video_content_right_right_content_2>.video_content_right_right_content_2_copys").hide();
	    $(".video_content_right_right_content_2>.video_content_right_right_content_2_copys:eq("+ index +")").show();
	  });
	  	
	    var video_str = window.location.href;  //接收地址
	    var temp = "";
	    var course_id;//接收本课程的ID
	   	var score_id = video_str.substring(video_str.lastIndexOf("/"));
	   	var isX = false;
	   	video_str = video_str.substring(0,video_str.lastIndexOf("/"));
	   	temp = video_str.split('').reverse().join('');//后面两个目录地址反转
	   	temp = video_str.substring(video_str.lastIndexOf("/"));//再次进行截取
		score_total(course_id,isX);//获取总体评分
		course_GetNotes(temp,score_id);//获取笔记
		$("#publish").click(function(){
	   		var publish_html = $("#contentText").html();
	   		course_SetNotes(temp,score_id,publish_html);
	   	});
	   	
		//评分
		var score_val1 = "";
		var score_val2 = "";
		$("#zh5ul li").click(function(){
			score_val1 = $(this).attr("val");
		});
			     
	     $("#zh5ul_2 li").click(function(){
	    	 score_val2 = $(this).attr("val");
	     });
	     
	     $("#btn_score").click(function(){
		     if(score_val1 != "" && score_val2 != ""){
		    	 score(score_val1,score_val2,course_id);
		     }
	     })
			     
	   	 //获取笔记
	   	 function course_GetNotes(list_id,children_id){
	   		 var content_Notes = "<c:url value='/study/course/getNotes'></c:url>";
		   	 var listId = children_id.substr(1);
		   	 var course_id = list_id.substr(1);
		   	 $.ajax({
		   		url: content_Notes,
		   		type:"POST",
		   		dataType:"JSON",
		   		data:{
		   			courseId: course_id,
		   			listId: listId,
		   		},
		   		success:function(data){
		   			//console.log(data);
		   			if(data.content != "null"){
		   				$("#contentText").html(data.content);
		   			}
		   		},
					complete : function(XMLHttpRequest, textStatus) {
		 				//console.log(XMLHttpRequest,textStatus);
		 			},
		   		error:function(error){
		   			//console.log(error);
		   		}
		   	 });
	   	 }
	     
	     //提交笔记
	     function course_SetNotes(list_id,children_id,html){
	    	 var content_Notes = "<c:url value='/study/course/updateNotes'></c:url>";
	    	 var cuorse_id = list_id.substr(1);
	    	 var list_id = children_id.substr(1);
	    	 $.ajax({
	    		url: content_Notes,
	    		type:"POST",
	    		dataType:"JSON",
	    		data:{
	    			courseId: cuorse_id,
	    			listId: list_id,
	    			content: html,
	    		},
	    		success:function(data){
	    			if(data.info === "保存成功"){
	    				$("#IsTrueInfo").show(10).delay(3000).hide(10);
	    			}
	    		},
				complete : function(XMLHttpRequest, textStatus) {
	  				//console.log(XMLHttpRequest,textStatus);
	  			},
	    		error:function(error){
	    			//console.log(error);
	    		}
	    	 });
	     }
	     
	     //获取总体评分
	     function score_total(total_id,isX){
	    	 var score_total_URL = "<c:url value='/grade/score/course_list/"+ total_id +"'></c:url>";
	    	 $.ajax({
	      		url: score_total_URL,
	      		type: "POST",
	      		dataType: "JSON",
	      		data:{},
	      		success:function(data){
	      			var AverageAccept = data.acceptScore / data.numCount * 20;//总体可接受度
	      			var AvarageQuality = data.qualityScore / data.numCount * 20;//总体课程内容质量
	      			$("#zh5_red_3").css("width", AverageAccept+"%");
	      			$("#zh5_red_4").css("width", AvarageQuality+"%");
	      			if(data.myQualityScore > 0 && data.myAcceptScore > 0){
	      				$("#zh5_red").addClass("cur"+ data.myAcceptScore);
	      				$("#zh5_red_2").addClass("cur"+ data.myQualityScore);
	      				$("#btn_score").attr("disabled",true);
	     				$("#btn_score").html("已提交评分");
	     				isX = true;
	     				isX_true(isX);
	      			}else{
	     				isX_true(isX);
	      			}
	      		},
	  			complete : function(XMLHttpRequest, textStatus) {
	    				//console.log(XMLHttpRequest,textStatus);
	    			},
	      		error:function(error){
	      			//console.log(error);
	      		}
	      	});
	     }
	     
	   //可接受度星级评定
	   function isX_true(is){
		  if(is == false){
			  $("#zh5ul li").each(function(index, element) {
			      var _this = $(this);
			      var nowStar = _this.attr("val");
			       _this.hover(function() {
			           $("#zh5_red").attr("class", "cur" + nowStar);
			       });
			
			      _this.on("click", function() {
			          $("#zh5_red").attr("data_star", nowStar);
			          _this.parent().parent().next().removeClass("error");
			      })
			  });
			
			  $("#zh5ul").on("mouseout", function() {
			      if ($("#zh5_red").attr("data_star")) {
			          $("#zh5_red").attr("class", "cur" + $("#zh5_red").attr("data_star"));
			      } else {
			          $("#zh5_red").removeClass();
			      }
			  });
			
		     //课程内容质量星级评定
		     $("#zh5ul_2 li").each(function(index, element) {
		         var _this = $(this);
		         var nowStar = _this.attr("val");
		          _this.hover(function() {
		              $("#zh5_red_2").attr("class", "cur" + nowStar);
		          });
		
		         _this.on("click", function() {
		             $("#zh5_red_2").attr("data_star", nowStar);
		             _this.parent().parent().next().removeClass("error");
		         })
		     });
		
		     $("#zh5ul_2").on("mouseout", function() {
		         if ($("#zh5_red_2").attr("data_star")) {
		             $("#zh5_red_2").attr("class", "cur" + $("#zh5_red_2").attr("data_star"));
		         } else {
		             $("#zh5_red_2").removeClass();
		         }
		     });
		  }
	   }
	     
	     //评分请求封装
	     function score(score_val1,score_val2,course_id){
	    	var score_URL = "<c:url value='/grade/add/course_list'></c:url>";
	     	$.ajax({
	     		url: score_URL,
	     		type: "POST",
	     		dataType: "JSON",
	     		data:{
	     			typeId: course_id,//课程ID
	     			accept: score_val1,//可接受程度评分
	     			quality: score_val2,//课程质量评分
	     		},
	     		success:function(data){
	     			if(data == true){
	     				$("#btn_score").attr("disabled",true);
	     				$("#btn_score").html("已提交评分");
	     			}
	     		},
	 			complete : function(XMLHttpRequest, textStatus) {
	   				//console.log(XMLHttpRequest,textStatus);
	   			},
	     		error:function(error){
	     			//console.log(error);
	     		}
	     	});
	     }
	     
	  //时间秒数格式化
	    function arrive_timer_format(s) {
	    	var t;
	    	if(s > -1){
	    	    hour = Math.floor(s/3600);
	    	    min = Math.floor(s/60) % 60;
	    	    sec = s % 60;
	    	    day = parseInt(hour / 24);
	    	    if (day > 0) {
	    	        hour = hour - 24 * day;
	    	        t = day + "day " + hour + ":";
	    	        }
	    	    else t = hour + ":";   
	    	    if(min < 10){t += "0";}
	    	        t += min + ":";
	    	    if(sec < 10){t += "0";}
	    	        t += sec;
	    	}
	    	return t;
	    	}
    });
  </script>

	<!-- 笔记文本框编辑保存、发布、清空 -->
  <script>

		$( "#contentText" ).keyup(function() {
		  $( "#exitMenuCheckbox" ).prop('checked', true);
		});

		$( "#bold" ).change(function() {
		  if($('#bold').prop('checked')){
		    $("#contentText").css("font-weight","bold");
		  }else{
		    $("#contentText").css("font-weight","normal");
		  }
		});

		$( "#italic" ).change(function() {
		  if($('#italic').prop('checked')){
		    $("#contentText").css("font-style","italic");
		  }else{
		    $("#contentText").css("font-style","normal");
		  }
		});

		$( "#underline" ).change(function() {
		  if($('#underline').prop('checked')){
		    $("#contentText").css("text-decoration","underline");
		  }else{
		    $("#contentText").css("text-decoration","none");
		  }
		});

		$( "#left" ).click(function() {
		  $("#contentText").css("text-align","left");
		});
		$( "#center" ).click(function() {
		  $("#contentText").css("text-align","center");
		});
		$( "#right" ).click(function() {
		  $("#contentText").css("text-align","right");
		});
		$( "#justify" ).click(function() {
		  $("#contentText").css("text-align","justify");
		});

		$(document).on('scroll', function() {
		   $( "#exitMenuCheckbox" ).prop('checked', true);
		});

		$( "#publish" ).mouseup(function() {
		  $("#articleHeaderName").text($("h1").text());
		});

		$( "#save" ).mouseup(function() {
		  $("#articleHeaderName").text($("h1").text()+" (Draft)");
		});

		$( "#delete" ).mouseup(function() {
		  $("#articleHeaderName").text("Create New Article");
		  $("h1").text("Simple blog editor - A great way of learning");
		  $("#contentText").text("");
		});
</script>
</body>
</html>
